#!/usr/bin/python
# -*- coding: UTF-8 -*-

""" 
@version: 1.0
@author: jin.li.o
@license: Apache Licence 
@contact: x.leevin@gmail.com
@software: PyCharm
@file: clazz_i_02.py
@time: 2018/10/15
"""


def fun1(pay):
    if pay == 1 or pay == 5 or pay == 10:
        print("选择饮料如下商品:")
        print("1.橙汁($3.5)")
        print("2.椰汁($4.0)")
        print("3.矿泉水($2.0)")
        print("4.早餐奶($4.5)")

        type = input("请选择饮料（输入对应编号即可）:")

        if type == "1":
            banlance = pay - 3.5
            if banlance > 0:
                print("购买了橙汁，找零：{0}".format(banlance))
            else:
                print("投入的金额不足，无法购买")
        elif type == "2":
            banlance = pay - 4
            if banlance > 0:
                print("购买了椰汁，找零：{0}".format(banlance))
            else:
                print("投入的金额不足，无法购买")
        elif type == "3":
            banlance = pay - 2
            if banlance > 0:
                print("购买了矿泉水，找零：{0}".format(banlance))
            else:
                print("投入的金额不足，无法购买")
        elif type == "4":
            banlance = pay - 4.5
            if banlance > 0:
                print("购买了早餐奶，找零：{0}".format(banlance))
            else:
                print("投入的金额不足，无法购买")

    else:
        print("不支持投入的金额，货币将返还，请注意查收。")


if __name__ == '__main__':
    fun1(10)
